<?php

use think\facade\Session;
use app\admin\library\Auth;


// 后台公共函数库

if (!function_exists('auth')) {
    /**
     * 访问权限检查
     * @param null|string $node
     * @return boolean
     * @throws ReflectionException
     */
    function auth(?string $node): bool
    {
    	$controller = request()->controller(true);
        $method = '/' . $controller . '/' . $node;

    	$admin = Session::get('AdminLogin');
        return Auth::instance()->check($method, $admin['id']);
    }
}